package com.banach.prema.repository.dataobject;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;

/**
 * 预警
 * @author ajun
 *
 */
@TableName("bnh_alarm")
public class AlarmDO {
	private Long id;
	private String title;
	private String content;	
	private Double lat;//求救纬度
	private Double lng;//求救经度
	
	private String province;//所属省份
	private String city;//所属城市 
	private String district;//所属区划
	private String adcode;//所属区划代码
	private String street;//所属道路（街道）

	private String streetNum;//街道号
	private LocalDateTime createTime;//创建时间
	private LocalDateTime updateTime;//更新时间
	@TableField(value = "user_id",fill = FieldFill.INSERT)
	private Long userId;//
	private String images;

	private String groupId;//创建时间

	private String status;//状态0为风险中，1为已解除
	private boolean deleted;

	public String getSimpleAddr(){
		String str = "";
		if(StringUtils.isNotEmpty(district)){
			str += district;
		}
		if(StringUtils.isNotEmpty(street)){
			str += street;
		}
		if(StringUtils.isNotEmpty(streetNum)){
			str += streetNum;
		}
		return str;
	}
	
	public String getFullAddr(){
		String str = "";
		if(StringUtils.isNotEmpty(province)){
			//str += province;
		}
		if(StringUtils.isNotEmpty(city)){
			str += city;
		}
		if(StringUtils.isNotEmpty(district)){
			str += district;
		}
		if(StringUtils.isNotEmpty(street)){
			str += street;
		}
		if(StringUtils.isNotEmpty(streetNum)){
			str += streetNum;
		}
		return str;
	}

	public Long getId() {
		return id;
	}

	public AlarmDO setId(Long id) {
		this.id = id;
		return this;
	}

	public String getTitle() {
		return title;
	}

	public AlarmDO setTitle(String title) {
		this.title = title;
		return this;
	}

	public String getContent() {
		return content;
	}

	public AlarmDO setContent(String content) {
		this.content = content;
		return this;
	}

	public Double getLat() {
		return lat;
	}

	public AlarmDO setLat(Double lat) {
		this.lat = lat;
		return this;
	}

	public Double getLng() {
		return lng;
	}

	public AlarmDO setLng(Double lng) {
		this.lng = lng;
		return this;
	}

	public String getProvince() {
		return province;
	}

	public AlarmDO setProvince(String province) {
		this.province = province;
		return this;
	}

	public String getCity() {
		return city;
	}

	public AlarmDO setCity(String city) {
		this.city = city;
		return this;
	}

	public String getDistrict() {
		return district;
	}

	public AlarmDO setDistrict(String district) {
		this.district = district;
		return this;
	}

	public String getAdcode() {
		return adcode;
	}

	public AlarmDO setAdcode(String adcode) {
		this.adcode = adcode;
		return this;
	}

	public String getStreet() {
		return street;
	}

	public AlarmDO setStreet(String street) {
		this.street = street;
		return this;
	}

	public String getStreetNum() {
		return streetNum;
	}

	public AlarmDO setStreetNum(String streetNum) {
		this.streetNum = streetNum;
		return this;
	}

	public LocalDateTime getCreateTime() {
		return createTime;
	}

	public AlarmDO setCreateTime(LocalDateTime createTime) {
		this.createTime = createTime;
		return this;
	}

	public LocalDateTime getUpdateTime() {
		return updateTime;
	}

	public AlarmDO setUpdateTime(LocalDateTime updateTime) {
		this.updateTime = updateTime;
		return this;
	}

	public Long getUserId() {
		return userId;
	}

	public AlarmDO setUserId(Long userId) {
		this.userId = userId;
		return this;
	}

	public String getImages() {
		return images;
	}

	public AlarmDO setImages(String images) {
		this.images = images;
		return this;
	}

	public String getGroupId() {
		return groupId;
	}

	public AlarmDO setGroupId(String groupId) {
		this.groupId = groupId;
		return this;
	}

	public String getStatus() {
		return status;
	}

	public AlarmDO setStatus(String status) {
		this.status = status;
		return this;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public AlarmDO setDeleted(boolean deleted) {
		this.deleted = deleted;
		return this;
	}
}
